C     Program EX_0305.FOR
C     Listing 5F - see documentation in TUTOR.SSS
 
$include:'SSSF1.H'
 
      subroutine prime
$include:'SSSF2.H'
 
      call INIQUE(0, 0, 2)
      call inista(1,'Outofstock       ', 0, 0, 0.0, 0.0)
      call inista(2,'Avestock         ', 1, 0, 0.0, 0.0)
      return
      end
 
      Program EX_0305
$include:'SSSF2.H'
      real*8 mean, c, lost
      data mean /2.0/, lost /1.0/
 
      call prime
 
      do 88 i=1, 3
        c = 15
        call SETT(30*(i-1))
        call TALLY(2, c)
        call SETT(T() + EX(mean))
 
        if (T().le.30*i) then
          if (c.gt.0) then
            c = c - 1
          else
            call TALLY(1, lost)
          endif
          call TALLY(2, c)
          call SETT(T() + EX(2))
        endif
  88  continue
 
      call SUMRY(' ')
      end
 